<link rel="stylesheet" type="text/css" href="/modules/mailsystemmodule/css/mailsystem.css">
<script type="text/javascript" src="/modules/mailsystemmodule/js/manage_main.js"></script>

<div id="mail_system_manage" style="height:550px;" data-options="tools:'#mail_system_manage_tools'">  
    <div title="Mail manage" data-options="closable:false" class="manage_tab">  
        <div id="_manage_mails" toolbar="#_manage_mails_tool">
        </div>        
    </div>  
    <div title="History manage" data-options="closable:false" class="manage_tab">  
        <div id="_manage_log" toolbar="#_manage_log_tool"></div>  
    </div>
    <div title="Email address" data-options="closable:false" class="manage_tab">  
        <div id="_manage_maddress" toolbar="#_manage_maddress_tool">
        </div>  
    </div>

</div>  

{*------Toolbar------*}
{*Tab tool*}
<div style="display:none">
    <div id="mail_system_manage_tools">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-redo'" onclick="_send_all_mail()">Send all mail</a>
        <a href="/index.php?module=mailsystemmodule&action=templates_manage" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-log'"  target="blank">Manage template</a>
    </div>
    {*Mail manage tool*}
    <div id="_manage_mails_tool" style="height:50px">

        <input id="_mail_search" style="width:180px" ></input>
        <div id="_mail_search_menu" style="width:120px">  
            <div data-options="name:'email_to'">Mail to</div> 
            <div data-options="name:'subject'">Subject</div>          
            <div data-options="name:'email_from'">Mail from</div> 
            <div data-options="name:'content'">Content</div>  
        </div>  

        <span class="form_date">From date</span>&nbsp;
        <input id="_mail_fd" name="from_date" required="true" style="width:110px">
        <span class="form_date">To date</span>&nbsp;
        <input id="_mail_td" name="to_date" required="true"  style="width:110px">
        <select id="_mail_combo_bl" class="easyui-combobox" name="state" style="width:100px; height:50px" required="true">
            <option value="0">Waiting</option>
            <option value="1">Sent</option>
            <option value="2">Error</option>

        </select>
        <select id="_mail_group" name="group" style="width:100px; height:50px">
            <option value="All">All</option>
            {foreach from=$groups item=group}
            <option value="{$group}">{$group}</option>
            {/foreach}
        </select>
        <a href="javascript:void(0);" class="easyui-linkbutton" onclick="jQuery('#_manage_mails').datagrid('reload');" iconCls="icon-filter" ></a>
        <br/>
        
         <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-view" plain="true" onclick="__mail_View()">View</a>
        <a href="#" class="easyui-splitbutton" data-options="menu:'#_mail_new_menu',iconCls:'icon-add'">New email</a>
        <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="__mail_Edit(false)">Forward</a>
        <a href="javascript:void(0);"  class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="__mail_Remove()">Delete</a>  
        <a href="javascript:void(0);" id="_mail_resend" title="Resend error mail" data-options="disabled:true" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="__mail_Resend()">Resend</a>  
        {*Menu new*}
        <div id="_mail_new_menu" style="width:150px;">  
            {foreach from=$temps item=temp}
            <div onclick="__mail_Edit('{$temp->id}')">{$temp->name}</div> 
            {/foreach}
        </div>
    </div>

   
    {*Log manage tool*}
    <div id="_manage_log_tool" style="height:50px">
        <input id="_log_search" style="width:250px" ></input>
        <div id="_log_search_menu" style="width:120px">  
            <div data-options="name:'email'">Email</div>  
            <div data-options="name:'type'">Type</div>  
            <div data-options="name:'description'">Description</div> 
        </div>
        <select id="_log_type" name="group" style="width:100px; height:50px" required="true">
            <option value="All">All</option>
            {foreach from=$log_types item=type}
            <option value="{$type}">{$type}</option>
            {/foreach}
        </select>  
        <span class="form_date">From date</span>&nbsp;
        <input id="_log_fd" name="from_date" required="true" style="width:110px">
        <span class="form_date">To date</span>&nbsp;
        <input id="_log_td" name="to_date" required="true"  style="width:110px">
        <a href="javascript:void(0);" class="easyui-linkbutton" onclick="jQuery('#_manage_log').datagrid('reload');" iconCls="icon-filter" ></a>

        <br>
        <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-view" plain="true" onclick="__log_View()">View</a>
        <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="__log_Remove()">Delete</a>   
        <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-clear" plain="true" onclick="__log_ClearAll()">Clear all</a>   
    </div> 
    {*Mail address manage tool*}
    <div id="_manage_maddress_tool" style="height:50px">
        <input id="_maddress_search" style="width:250px" ></input>
        <div id="_maddress_search_menu" style="width:120px">  
            <div data-options="name:'email'">Email</div>  
        </div>
        <select id="_maddress_block" name="group" style="width:100px; height:50px" required="true">
            <option value="All">All</option>
            <option value="1">Block</option>
            <option value="0">No block</option>

        </select>  
        <span class="form_date">From date</span>&nbsp;
        <input id="_maddress_fd" name="from_date" required="true" style="width:110px">
        <span class="form_date">To date</span>&nbsp;
        <input id="_maddress_td" name="to_date" required="true"  style="width:110px">
        <a href="javascript:void(0);" class="easyui-linkbutton" onclick="jQuery('#_manage_log').datagrid('reload');" iconCls="icon-filter" ></a>
        <br>
        <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-lock" plain="true" onclick="__maddress_block()">Block</a>
        <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-unlock" plain="true" onclick="__maddress_unblock()">Unblock</a>   
    </div>

</div>


{*------Dialog--------*}
{*Mail view dialog*}
<div id="_mail_view">
    <div id="_mail_view_content" class="_dialog"></div>
</div> 
{*Log view dialog*}
<div id="_log_view">
    <div id="_log_view_content" class="_dialog"></div>
</div> 

{*Loading*}
<div style="display:none"> 
    <div id="loading_win" style="width:400px;height:150px">
        <center><br><img src="/modules/mailsystemmodule/images/loading1.gif" border="0" width="76" alt="Loading..."><br><br>
            <div id="loading_mes" style="font-size:25px">Loading...</div>
        </center> 
    </div>
</div>
{*JS*}
{literal}
<script type="text/javascript">
    var _temp={/literal}{$jtemp}{literal};
    </script>
{/literal}
